home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 1959 < prev    next >
Encoding:
Text File  |  1996-08-05  |  3.0 KB  |  82 lines

  1. Path: informatik.tu-muenchen.de!fischerj
  2. From: fischerj@informatik.tu-muenchen.de (Juergen "Rally" Fischer)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: PPC compilers
  5. Date: 25 Jan 1996 15:36:54 GMT
  6. Organization: Technische Universitaet Muenchen, Germany
  7. Distribution: world
  8. Message-ID: <4e882m$k7u@sunsystem5.informatik.tu-muenchen.de>
  9. References: <4d42gg$i2p@ra.ibr.cs.tu-bs.de> <4dov8s$rc5@ar.ar.com.au> <38232132@kone.fipnet.fi> <1205.6597T1252T932@ifi.uio.no>
  10. NNTP-Posting-Host: hphalle5h.informatik.tu-muenchen.de
  11. Originator: fischerj@hphalle5h.informatik.tu-muenchen.de
  12.  
  13.  
  14. In article <1205.6597T1252T932@ifi.uio.no>, ludvigp@ifi.uio.no (Ludvig Pedersen) writes:
  15. |> Organization: Dept. of Informatics, University of Oslo, Norway
  16. |> Lines: 39
  17. |> Message-ID: <1205.6597T1252T932@ifi.uio.no>
  18. |> References: <4d42gg$i2p@ra.ibr.cs.tu-bs.de> <4dov8s$rc5@ar.ar.com.au> <38232132@kone.fipnet.fi>
  19. |> NNTP-Posting-Host: gymir.ifi.uio.no
  20. |> X-Newsreader: THOR 2.22 (Amiga;TCP/IP)
  21. |> 
  22. |> 
  23. |> >> To do fast 16:16 bit fixed point maths (ie for bitmap scaling). You have
  24. |> >> the fraction in the  high word and the integer part in the low word.
  25. |> >>áBecause of the addx, every time the fraction wraps around, the X bit is set
  26. |> >>áand next add, the integer bit is incremented.
  27. |> >Addx is really great .. Hmm. We could think of all the
  28. |> >situations where addx could possibly go wrong. (I mean
  29. |> >fixed point interpolations)
  30. |> >At least this has to be done before the loop:
  31. |> >        moveq   #0,d0
  32. |> >        add.l   d1,d0
  33. |> 
  34. |> >        ...
  35. |> >.loop   addx.l  d1,d2
  36. |> >        dbf     d7,.loop
  37. |> 
  38. |> >But what about if there is two addx? Theis decimal parts
  39. |> >have to be switched, which is done nicely with eor
  40. |> >before swapping, but what about that before loop
  41. |> >correction? Of course this perfect accuracy
  42. |> >is not required on 16.16 fixed point but if
  43. |> >there is a smaller amount of fraction, the
  44. |> >errors can be quite big..
  45. |> 
  46. |> Using
  47. |>         sub.w   dx,dx
  48. |> 
  49. |> instead of
  50. |> 
  51. |>         moveq   #0,d0
  52. |>         add.l   d1,d0
  53.  
  54. what about cmp.x dx,dx
  55. won't trash dx ;) the aim was to get X flag 0 right ?
  56.  
  57. mhm in my routine I had to do a previous add in the outer loop, it did
  58. same addition like the inner, BUT only on lo fraction.
  59.  
  60. So I cause the X that actually will be needed by the inner loop addx
  61. (Without previous add, the addx will cause the X it would have needed
  62. before!).
  63.  
  64. Clearing X maybe gives less noise, but not correct :)
  65. hope I'm talking about same things like you... ;)
  66.  
  67. |> 
  68. |> is faster by-the-way. And since we are only using the lower word of the
  69. |> register we don't need to use an extra dataregister.
  70.  
  71. sub.b dx,dx would even have trashed only the lower _byte_ ;)
  72. but all instructions tend to need lower byte ;)
  73.  
  74. |> 
  75. |> <sb>Ludde - Amiga Demo Coder
  76. |> <sb>Virtual Reality & Official Be developer
  77. |> <sb>ludvigp@ifi.uio.no
  78. |> 
  79. ------------------------------------------------------------------------
  80.    fischerj@Informatik.TU-Muenchen.DE (Juergen "Rally" Fischer)   =:)
  81.  
  82.